package db

import (
	"gitee.com/baizhige/simple-auth-go/schema"
	"time"
)

var users = []User{
	{"01", "name1", []string{"user_add", "user_query"}}, //模拟拥有全部权限的用户
	{"02", "name2", []string{"user_query"}},             //模拟拥权限较少的用户
}

type User struct {
	Id             string
	Name           string
	Authorizations []string
}

func (u User) GetLoginConfig() schema.LoginConfig {
	return schema.LoginConfig{
		TokenKey: "user_token",
		Expire:   15 * time.Minute,
	}
}

func (u User) GetAuthorizations() []string {
	return u.Authorizations
}
